<?php
session_start();
include 'db.php';
include 'userclass.php';

$UserId = $user->getID();
$link=$_GET['link'];

$sql = 'UPDATE li_links SET Count = Count+1 WHERE UserId = :UserId AND Url = :link';
$sth = $db->prepare($sql);
$sth->bindParam(':link',$link);
$sth->bindParam(':UserId', $UserId);
$sth->execute();
header('Location:'.$link);